import Vue from 'vue'
import Vuex from 'vuex'
import global from './modules/global'
import backendShop from './modules/backend-shop'
import backendHome from './modules/backend-home'
import backendCate from './modules/backend-cate'
import backendCateOld from './modules/backend-cateOld'
import backendJifen from './modules/backend-jifen'
import backendCoupon from  './modules/backend-coupon'
import backendMessage from  './modules/backend-message'
import backendTempOrder from  './modules/backend-tempOrder'
import backendOrder from './modules/backend-order'
import backendManagement from  './modules/backend-management'
import backendRenegade from  './modules/backend-renegade'
import frontendCart from './modules/frontend-cart'
import frontendGoods from  './modules/frontend-goods'
import globalUser from './modules/global-user'
Vue.use(Vuex)


export default new Vuex.Store({
  modules: {
    backend: {
      namespaced: true,
      modules: {
        shop: backendShop,
        home: backendHome,
        cate: backendCate,
        cateOld: backendCateOld,
        jifen: backendJifen,
        coupon: backendCoupon,
        message: backendMessage,
        tempOrder: backendTempOrder,
        order: backendOrder,
        management: backendManagement,
        renegade: backendRenegade
      }
    },
    frontend: {
      namespaced: true,
      modules: {
        cart: frontendCart,
        goods: frontendGoods
      }
    },
    global: {
      namespaced: true,
      ...global,
      modules: {
        user: globalUser
      }
    }
  }
})
